# Copyright (c) Huoty, All rights reserved
# Author: Huoty <sudohuoty@163.com>

import os
from setuptools import setup


CURRDIR = os.path.dirname(os.path.abspath(__file__))


setup_args = dict(
    name='ipython-language-magic',
    version='0.0.1',
    description='Directly execute code in various programming languages within IPython.',
    py_modules=['ipython_language_magic'],
    author='huoty',
    author_email='sudohuoty@163.com',
    url='https://gitee.com/konghy/ipython-language-magic',
    zip_safe=False,
    platforms=["any"],
    classifiers=[
        'Programming Language :: Python',
        'Programming Language :: Python :: 3',
    ],
)


def get_version():
    version = '0.1.0'
    scope = {}
    version_file = os.path.join(CURRDIR, "ipython_language_magic.py")
    if os.path.exists(version_file):
        with open(version_file) as fp:
            exec(fp.read(), scope)
        version = scope.get('__version__', '1.0')
    return version


def main():
    setup_args["version"] = get_version()
    setup(**setup_args)


if __name__ == "__main__":
    main()
